<?php
/**
 * Registering a router
 */
$di -> setShared('router', function () {
    $router = new \Phalcon\Mvc\Router(false);
	//$router -> removeExtraSlashes(true);

	$router -> setDefaultModule('frontend');
	$router -> setDefaultController('Index');
	$router -> setDefaultAction('index');

	$router -> mount(include SRC_PATH . 'modules' . DS . 'backstage' . DS . 'routes.php');
	$router -> mount(include SRC_PATH . 'modules' . DS . 'frontend' . DS . 'routes.php');
	$router -> mount(include SRC_PATH . 'modules' . DS . 'products' . DS . 'routes.php');
	$router -> mount(include SRC_PATH . 'modules' . DS . 'uploads' . DS . 'routes.php');
	$router -> mount(include SRC_PATH . 'modules' . DS . 'user' . DS . 'routes.php');

	$router -> notFound([
		'module'     => 'frontend',
        'controller' => 'index',
        'action'     => 'notFound'
	]);

    return $router;
});
?>